use axum::{
    routing::{ get, post, put },
    Router,
    middleware
};
mod master;
use crate::_pub::pc::user::user_1;

pub fn auth_no_routes() -> Router{
    Router::new()
    .route("/login",      post(user_1::login))
}

pub fn auth_routes() -> Router{
    Router::new()
    .route("/", get(master::list).post(master::save).put(master::save))
    .route("/{id}", get(master::find))
    .route("/disabled", put(master::disabled))
    .route("/renewal", put(master::renewal))
    .route("/mod_pwd", put(master::mod_pwd))
    .route_layer(middleware::from_fn(com::perm::admin::auth))
    .route("/logout",      post(user_1::logout))
}